<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>

</body>
<script>
    // 定义对象数据
    let a = {
        value: 1
    };
    let b = {
        value: 2
    };

    // 定义处理器
    const handleA = {
        get(target, prop) {
            console.log(`获取A:${prop}的值`);
            return target[prop];
        },
        set(target, key, value) {
            console.log(`设置A:${key}的值${value}`);
            target[key] = value;
        }
    };

    const handleB = {
        get(target, prop) {
            console.log(`获取B:${prop}的值`);
            return target[prop];
        },
        set(target, key, value) {
            console.log(`设置B:${key}的值${value}`);
            target[key] = value;
        }
    };

    let pa = new Proxy(a, handleA);
    let pb = new Proxy(b, handleB);
    let sum = pa.value + pb.value;
    pa.value = 3;
    pb.value = 4;

</script>
</html>